package com.itramp.shaker;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.webkit.WebView;

/**
 * Welcome activity,it shows a html page.
 * 
 * @author qingshan_liu
 * @since 2011-10-13
 */
public class Welcome extends Activity {
	//private Activity that;
	private WebView wbView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {	
		//that=Welcome.this;
		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.view_web);

		wbView = (WebView) findViewById(R.id.wv_local);

		//apk assets: html page which contained in assets folder of apk 
		wbView.loadUrl("file:///android_asset/html/welcome.htm");
		//sdcard: wbView.loadUrl("content://com.android.htmlfileprovider/sdcard/xxx.html")
		//internet: wbView.loadUrl("http://www.itramp.cn")

		new CountDownTimer(3000,1000){

			@Override
			public void onTick(long millisUntilFinished) {
				//ShakerUtil.showMessage(that, ""+millisUntilFinished/100);
			}

			@Override
			public void onFinish() {
				Intent redirectIntt = new Intent(Welcome.this,
						IndexActivity.class);
				Welcome.this.startActivity(redirectIntt);
				Welcome.this.finish();
			}
			
		}.start();
		
		/*new Handler().postDelayed(new Runnable() {

			@Override
			public void run() {
				Intent redirectIntt = new Intent(ViewWeb.this,
						IndexActivity.class);
				ViewWeb.this.startActivity(redirectIntt);
				ViewWeb.this.finish();
			}
		}, 500000);*/
	}
}
